<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<button type="button" class="btn btn-navbar" data-toggle="collapse"
					data-target=".nav-collapse">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="brand" href="#{request.contextPath}/index.jsf">Signup
					App Demo</a>

				<div class="nav-collapse collapse">
					<ui:fragment
						rendered="#{facesContext.externalContext.remoteUser ne null}">
						<ul class="nav">
							<li
								class="#{request.servletPath.startsWith('/admin/unconfirmed')?'active':''}"><h:link
									id="unconfirmedLink" outcome="/admin/unconfirmed.xhtml"
									value="Unconfirmed" /></li>
							<li
								class="#{request.servletPath.startsWith('/admin/confirmed')?'active':''}"><h:link
									id="confirmedLink" outcome="/admin/confirmed.xhtml"
									value="Confirmed" /></li>
							<li
								class="#{request.servletPath.startsWith('/admin/approved')?'active':''}"><h:link
									id="approvedLink" outcome="/admin/approved.xhtml"
									value="Approved" /></li>
							<li
								class="#{request.servletPath.startsWith('/admin/denied')?'active':''}"><h:link
									id="deniedLink" outcome="/admin/denied.xhtml" value="Denied" /></li>
							<li
								class="#{request.servletPath.startsWith('/register.xhtml')?'active':''}"><h:link
									id="registerLink" outcome="/register.xhtml" value="Register" /></li>
							<li
								class="#{request.servletPath.startsWith('/registerRest')?'active':''}"><h:link
									id="registerRestLink" outcome="/registerRest.xhtml" value="Register via REST API" /></li>
						</ul>
						<div  class="navbar-text pull-right">
							Logged in as <h:outputText value="#{facesContext.externalContext.remoteUser}"
								style="color:white; padding-right:10px;" />
							<h:commandLink id="logoutButton" styleClass="btn btn-primary"
								action="#{loginAction.logout()}" value="Logout" style="margin-bottom:5px;"/>
						</div>
					</ui:fragment>
					<ui:fragment
						rendered="#{facesContext.externalContext.remoteUser eq null}">
						<div class="pull-right">
							<h:link outcome="/login?faces-redirect=true"
								styleClass="btn btn-primary" value="Login" />
						</div>
					</ui:fragment>
				</div>
			</div>
		</div>
	</div>
</ui:composition>
